import React from 'react';
import dynamic from 'dva/dynamic';
import { Route } from 'dva/router';

export default function gotosearchRoute(app) {

    const GotoSearch = dynamic({
        app,
        models: () => {
            return [
               import(/* webpackChunkName: "gotoSearchModel" */'../models/search/gotoSearchModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "gotosearch" */'../routes/search/GotoSearch'),
    });

    const GoodSearch = dynamic({
        app,
        models: () => {
            return [
                import(/* webpackChunkName: "goodsSearchModel" */'../models/search/GoodSearchModel'),
            ];
        },
        component: () => import(/* webpackChunkName: "goodsearch" */'../routes/search/GoodsSearch'),
    });


    return (
        [
            <Route key="/gotosearch" exact strict path="/gotosearch" component={GotoSearch}/>,
            <Route key="/goodsearch" exact strict path="/goodsearch/:searchType" component={GoodSearch}/>
        ]
    );
}
